import echarts from "echarts";
import { EChartsOptions } from "pao-aop-client/lib/react/components/charts/echarts_helper";
// 上部折线图option
export let lineOption: EChartsOptions = {
    legend: {
        show: false
    },
    grid: {
        left: '5'
    },
    xAxis: {
        show: false,
        type: 'category',
        boundaryGap: false,
        axisLine: {
            show: false
        },
        axisLabel: {
            interval: 0,
            // rotate: 40
        }
    },
    yAxis: {
        show: false,
        type: 'value',
        nameTextStyle: {
            fontSize: 11,
        },
        splitNumber: 4,
        axisLabel: {
            fontSize: 9
        },
        axisLine: {
            show: false
        },
    },
    series: [{
        name: '数量',
        type: 'line',
        smooth: true,
        data: [],
        areaStyle: {},
        label: {
            normal: {
                show: true,
                position: 'top',
                color: '#ffffff'
            }
        },
        animationDelay: function (idx: number) {
            return idx * 10;
        },
        itemStyle: {
            color: new (echarts.graphic as any).LinearGradient(0, 0, 0, 1, [
                { offset: 1, color: 'rgba(15,121,203,1)' }
            ])
        },
        barWidth: 32
    }]
};
// 上部柱状图图option
export let barOption: EChartsOptions = {
    legend: {
        show: false
    },
    xAxis: {
        type: 'category',
        boundaryGap: true,
        axisLine: {
            lineStyle: {
                color: '#4c4c4c'
            }
        },
        axisLabel: {
            interval: 0,
            // rotate: 40
        }
    },
    yAxis: {
        type: 'value',
        nameTextStyle: {
            fontSize: 11,
        },
        splitNumber: 4,
        axisLabel: {
            fontSize: 24
        },
        axisLine: {
            lineStyle: {
                color: '#4c4c4c'
            }
        },
    },
    series: [{
        name: '数量',
        type: 'bar',
        data: [],
        label: {
            normal: {
                show: true,
                position: 'top',
                color: '#ffffff'
            }
        },
        animationDelay: function (idx: number) {
            return idx * 10;
        },
        itemStyle: {
            color: new (echarts.graphic as any).LinearGradient(0, 0, 0, 1, [
                { offset: 0, color: 'rgba(62,240,247,1)' },
                { offset: 1, color: 'rgba(15,121,203,1)' }
            ])
        },
        barWidth: 32
    }]
};